package com.battery.system.service.battery;

import com.battery.system.domain.BO.IncomeBO;
import com.battery.system.domain.Income;
import com.battery.system.domain.IncomeTrend;
import com.battery.system.domain.VO.*;
import com.battery.system.service.IBaseService;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * 收益Service接口
 *
 * @author battery
 * @date 2021-01-22
 */
public interface IIncomeService extends IBaseService<Income> {

    /**
     * 查询收益
     *
     * @param id 收益ID
     * @return 收益
     */
    public Income selectIncomeById(String id);

    /**
     * 查询收益列表
     *
     * @param income 收益
     * @return 收益集合
     */
    public List<Income> selectIncomeList(Income income);

    /**
     * 新增收益
     *
     * @param income 收益
     * @return 结果
     */
    public int insertIncome(Income income);

    /**
     * 修改收益
     *
     * @param income 收益
     * @return 结果
     */
    public int updateIncome(Income income);

    /**
     * 批量删除收益
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    public int deleteIncomeByIds(String ids);

    /**
     * 删除收益信息
     *
     * @param id 收益ID
     * @return 结果
     */
    public int deleteIncomeById(String id);


    BillDetails selectIncomeSum(Map<String, String> map);

    List<BillDetails> selectIncomeGroup(Map<String, String> map);


    IncomeCount selectIncomeByCount(Map<String, String> map);

    IncomeCount selectIncomeByCountDetails(String id, int type, int toDay, String start, String end);


    List<IncomeCount> selectIncomeByMyIncome(Map<String, String> map);

    PartnerCount selectPartnerByStoreCount(String id);

    List<StoreCount> selectPartnerByStoreGroup(Map<String, String> map);

    /**
     * 分润操作
     *
     * @param used_id
     * @param order_id
     */
    public void shareMoney(String used_id, String order_id);

    /**
     * 进行退款操作
     *
     * @param used_id
     * @param order_id
     * @param refund_order_id
     */
    public void refundShareMoney(String used_id, String order_id, String refund_order_id);

    /**
     * 查看收益列表
     *
     * @param incomeBO
     * @return
     */
    List<IncomeVO> selectIncomeVOList(IncomeBO incomeBO);

    List<IncomeTrend> selectIncomeByTrendDay(Map<String, String> map);

    List<IncomeTrend> selectIncomeByTrendMonth(Map<String, String> map);

    List<IncomeTrend> selectIncomeByTrendWeek(Map<String, String> map);

    /**
     * 贡献收支明细 (门店贡献收支明细)
     *
     * @param map
     * @return
     */
    List<Income> incomeRecordByMap(Map<String, String> map);

    /**
     * 账单明细
     *
     * @param incomeBO
     * @return
     */
    List<IncomeVO> selectOnlyIncomeVOList(IncomeBO incomeBO);

    /**
     * 查询该账号在此租借订单，拿到的收益
     *
     * @param usedId
     * @param accountId
     * @param accountType
     * @return
     */
    BigDecimal selectAccountByUsedId(String usedId, String accountId, int accountType);
}
